package com.carey.blog.model;

import org.json.JSONArray;
import org.json.JSONObject;

import com.carey.blog.framework.latke.Keys;

/**
 * This class defines all comment model relevant keys.
 * 
 */
public final class Preference {

	/**
	 * Preference.
	 */
	public static final String PREFERENCE = "preference";
	/**
	 * Blog title.
	 */
	public static final String BLOG_TITLE = "blogTitle";
	/**
	 * Blog subtitle.
	 */
	public static final String BLOG_SUBTITLE = "blogSubtitle";
	/**
	 * Relevant articles display count.
	 */
	public static final String RELEVANT_ARTICLES_DISPLAY_CNT = "relevantArticlesDisplayCount";
	/**
	 * Random articles display count.
	 */
	public static final String RANDOM_ARTICLES_DISPLAY_CNT = "randomArticlesDisplayCount";
	/**
	 * External relevant articles display count.
	 */
	public static final String EXTERNAL_RELEVANT_ARTICLES_DISPLAY_CNT = "externalRelevantArticlesDisplayCount";
	/**
	 * Recent article display count.
	 */
	public static final String RECENT_ARTICLE_DISPLAY_CNT = "recentArticleDisplayCount";
	/**
	 * Recent comment display count.
	 */
	public static final String RECENT_COMMENT_DISPLAY_CNT = "recentCommentDisplayCount";
	/**
	 * Most used tag display count.
	 */
	public static final String MOST_USED_TAG_DISPLAY_CNT = "mostUsedTagDisplayCount";
	/**
	 * Most comment article display count.
	 */
	public static final String MOST_COMMENT_ARTICLE_DISPLAY_CNT = "mostCommentArticleDisplayCount";
	/**
	 * Most view article display count.
	 */
	public static final String MOST_VIEW_ARTICLE_DISPLAY_CNT = "mostViewArticleDisplayCount";
	/**
	 * Article list display count.
	 */
	public static final String ARTICLE_LIST_DISPLAY_COUNT = "articleListDisplayCount";
	/**
	 * Article list pagination window size.
	 */
	public static final String ARTICLE_LIST_PAGINATION_WINDOW_SIZE = "articleListPaginationWindowSize";
	/**
	 * Blog host.
	 */
	public static final String BLOG_HOST = "blogHost";
	/**
	 * Administrator's email.
	 */
	public static final String ADMIN_EMAIL = "adminEmail";
	/**
	 * Locale string.
	 */
	public static final String LOCALE_STRING = "localeString";
	/**
	 * Time zone id.
	 */
	public static final String TIME_ZONE_ID = "timeZoneId";
	/**
	 * Notice board.
	 */
	public static final String NOTICE_BOARD = "noticeBoard";
	/**
	 * HTML head.
	 */
	public static final String HTML_HEAD = "htmlHead";
	/**
	 * Key of OAuth consumer secret.
	 */
	public static final String GOOGLE_OAUTH_CONSUMER_SECRET = "googleOAuthConsumerSecret";
	/**
	 * Key of enable post to Buzz.
	 */
	public static final String ENABLE_POST_TO_BUZZ = "enablePostToBuzz";
	/**
	 * Key of meta keywords.
	 */
	public static final String META_KEYWORDS = "metaKeywords";
	/**
	 * Key of meta description.
	 */
	public static final String META_DESCRIPTION = "metaDescription";
	/**
	 * Key of article update hint flag.
	 */
	public static final String ENABLE_ARTICLE_UPDATE_HINT = "enableArticleUpdateHint";
	/**
	 * Key of current version number.
	 */
	public static final String CURRENT_VERSION_NUMBER = "currentVersionNumber";
	/**
	 * Key of signs.
	 */
	public static final String SIGNS = "signs";
	/**
	 * Key of tencent micro blog app key.
	 */
	public static final String TENCENT_MICROBLOG_APP_KEY = "tencentMicroblogAppKey";
	/**
	 * Key of tencent micro blog app secret.
	 */
	public static final String TENCENT_MICROBLOG_APP_SECRET = "tencentMicroblogAppSecret";
	/**
	 * Key of tencent micro blog token key.
	 */
	public static final String TENCENT_MICROBLOG_TOKEN_KEY = "tencentMicroblogTokenKey";
	/**
	 * Key of tencent micro blog token secret.
	 */
	public static final String TENCENT_MICROBLOG_TOKEN_SECRET = "tencentMicroblogTokenSecret";
	/**
	 * Key of enable post to tencent micro blog.
	 */
	public static final String ENABLE_POST_TO_TENCENT_MICROBLOG = "enablePostToTencentMicroblog";
	/**
	 * Key of sina micro blog app key.
	 */
	public static final String SINA_MICROBLOG_APP_KEY = "sinaMicroblogAppKey";
	/**
	 * Key of sina micro blog app secret.
	 */
	public static final String SINA_MICROBLOG_APP_SECRET = "sinaMicroblogAppSecret";
	/**
	 * Key of sina micro blog token key.
	 */
	public static final String SINA_MICROBLOG_TOKEN_KEY = "sinaMicroblogTokenKey";
	/**
	 * Key of sina micro blog token secret.
	 */
	public static final String SINA_MICROBLOG_TOKEN_SECRET = "sinaMicroblogTokenSecret";
	/**
	 * Key of enable post to sina micro blog.
	 */
	public static final String ENABLE_POST_TO_SINA_MICROBLOG = "enablePostToSinaMicroblog";
	
	/**
	 *Key of  baidu zone username.
	 * */
	public static final String BAIDU_ZONE_USERNAME = "baiduZoneUsername";
	
	/**
	 * Key of baidu zone password.
	 * */
	public static final String BAIDU_ZONE_PASSWORD = "baiduZonePassword";
	
	/**
	 * Key of enable post to baidu zone.
	 */
	public static final String ENABLE_POST_TO_BAIDU_ZONE = "enablePostToBaiduZone";
	
	/**
	 * Key of key of Solo.
	 */
	public static final String KEY_OF_SOLO = "keyOfSolo";

	
	/**
	 * Private default constructor.
	 */
	private Preference() {
	}

	/**
	 * Default preference.
	 * 
	 */
	public static final class Default {

		/**
		 * Default recent article display count.
		 */
		public static final int DEFAULT_RECENT_ARTICLE_DISPLAY_COUNT = 10;
		/**
		 * Default recent comment display count.
		 */
		public static final int DEFAULT_RECENT_COMMENT_DISPLAY_COUNT = 10;
		/**
		 * Default most used tag display count.
		 */
		public static final int DEFAULT_MOST_USED_TAG_DISPLAY_COUNT = 20;
		/**
		 * Default article list display count.
		 */
		public static final int DEFAULT_ARTICLE_LIST_DISPLAY_COUNT = 20;
		/**
		 * Default article list pagination window size.
		 */
		public static final int DEFAULT_ARTICLE_LIST_PAGINATION_WINDOW_SIZE = 15;
		/**
		 * Default most comment article display count.
		 */
		public static final int DEFAULT_MOST_COMMENT_ARTICLE_DISPLAY_COUNT = 5;
		/**
		 * Default blog title.
		 */
		public static final String DEFAULT_BLOG_TITLE = "Carey Blog 示例";
		/**
		 * Default blog subtitle.
		 */
		public static final String DEFAULT_BLOG_SUBTITLE = "GAE上的一朵云";
		/**
		 * Default skin directory name.
		 */
		public static final String DEFAULT_SKIN_DIR_NAME = "classic";
		/**
		 * Default blog host.
		 */
		public static final String DEFAULT_BLOG_HOST = "localhost:8080";
		/**
		 * Default language.
		 */
		public static final String DEFAULT_LANGUAGE = "zh_CN";
		/**
		 * Default time zone.
		 * 
		 * @see java.util.TimeZone#getAvailableIDs()
		 */
		public static final String DEFAULT_TIME_ZONE = "Asia/Shanghai";
		/**
		 * Default enable article update hint.
		 */
		public static final boolean DEFAULT_ENABLE_ARTICLE_UPDATE_HINT = true;
		/**
		 * Default notice board.
		 */
		public static final String DEFAULT_NOTICE_BOARD = "宝剑锋从磨砺出, <br/>梅花香自苦寒来!";
		/**
		 * Default meta keywords..
		 */
		public static final String DEFAULT_META_KEYWORDS = "GAE blog";
		/**
		 * Default meta description..
		 */
		public static final String DEFAULT_META_DESCRIPTION = "An open source blog based on GAE Java.";
		/**
		 * Default HTML head to append.
		 */
		public static final String DEFAULT_HTML_HEAD = "";
		/**
		 * Default OAuth consumer secret for Google.
		 */
		public static final String DEFAULT_GOOLE_OAUTH_CONSUMER_SECRET = "";
		/**
		 * Default enable post to Buzz.
		 */
		public static final boolean DEFAULT_ENABLE_POST_TO_BUZZ = false;
		/**
		 * Default relevant articles display count.
		 */
		public static final int DEFAULT_RELEVANT_ARTICLES_DISPLAY_COUNT = 5;
		/**
		 * Default random articles display count.
		 */
		public static final int DEFAULT_RANDOM_ARTICLES_DISPLAY_COUNT = 5;
		/**
		 * Default external relevant articles display count.
		 */
		public static final int DEFAULT_EXTERNAL_RELEVANT_ARTICLES_DISPLAY_COUNT = 5;
		/**
		 * Most view articles display count.
		 */
		public static final int DEFAULT_MOST_VIEW_ARTICLES_DISPLAY_COUNT = 5;
		/**
		 * Default signs.
		 */
		public static final String DEFAULT_SIGNS;

		static {
			final JSONArray signs = new JSONArray();

			final int signLength = 4;
			try {
				for (int i = 0; i < signLength; i++) {
					final JSONObject sign = new JSONObject();
					sign.put(Keys.OBJECT_ID, i);
					signs.put(sign);

					sign.put(Sign.SIGN_HTML, "");
				}

				// Sign(id=0) is the 'empty' sign, used for article user needn't
				// a sign

				DEFAULT_SIGNS = signs.toString();
			} catch (final Exception e) {
				throw new RuntimeException(e);
			}
		}

		/**
		 * Private default constructor.
		 */
		private Default() {
		}
	}
}
